﻿using DGIS.Service.Enum;
using DGIS.Service.Model;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Geodatabase;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DGIS.Service.IService.IDataService
{
    public interface IDataOpenService
    {
        /// <summary>
        /// 从shpfile中读取数据
        /// </summary>
        /// <param name="shpPath">shpfile路径</param>
        /// <returns></returns>
        IFeatureLayer OpenFromShp(string shpPath);

        /// <summary>
        /// 从MDB中读取数据
        /// </summary>
        /// <param name="mdbPath">MDB路径</param>
        /// <param name="layerName">需要读取的图层名称</param>
        /// <returns></returns>
        IFeatureLayer OpenFromMDB(string mdbPath, string layerName);

        /// <summary>
        /// 从geodatabase中读取数据
        /// </summary>
        /// <param name="gdbPath">geodatabase路径</param>
        /// <param name="layerName">需要读取图层名称</param>
        /// <returns></returns>
        IFeatureLayer OpenFromGDB(string gdbPath, string layerName);
                
        /// <summary>
        /// 从sde中读取图层
        /// </summary>
        /// <param name="server">sde服务地址</param>        
        /// <param name="userName">用户名</param>
        /// <param name="psw">密码</param>
        /// <param name="dataBaseName">sde数据库名称</param>
        /// <param name="sdeType">sde类型</param>
        /// <param name="layerName">需要读取图层名称</param>
        /// <returns></returns>
        IFeatureLayer OpenFromSDE(string server, string userName, string psw, string dataBaseName, SDETypeEnum sdeType, string layerName);
        
        /// <summary>
        /// 从工作空间中获取图层列表
        /// </summary>
        /// <param name="dbPath">数据库路径</param>
        /// <param name="type">数据库的空间类型</param>
        /// <param name="workSpace">输出工作空间</param>
        /// <returns></returns>
        List<DataLayer> GetLayerList(string dbPath,WorkspaceTypeEnum type,out IWorkspace workSpace);

        /// <summary>
        /// 从sde中获取图层列表
        /// </summary>
        /// <param name="server"></param>
        /// <param name="userName"></param>
        /// <param name="psw"></param>
        /// <param name="dataBaseName"></param>
        /// <param name="sdeType"></param>
        /// <param name="workSpace"></param>
        /// <returns></returns>
        List<DataLayer> GetLayerList(string server, string userName, string psw, string dataBaseName, SDETypeEnum sdeType,out IWorkspace workSpace);
    }
}
